Parameters
- e
- the
XElement
XElement
XElement
.This sets this node data's properties by reading the data from attributes and nested elements of the given XElement
.
Because the NodeKey type might be a type for which we have an implementation to convert to and from strings for XML, this calls the ConvertStringToNodeKey method, which you can override.
This is implemented as: public virtual void LoadFromXElement(XElement e) { this.Key = XHelper.Read<NodeKey>("Key", e, default(NodeKey), ConvertStringToNodeKey); this.Category = XHelper.Read("Category", e, ""); this.IsLinkLabel = XHelper.Read("IsLinkLabel", e, false); this.IsSubGraph = XHelper.Read("IsSubGraph", e, false); this.IsSubGraphExpanded = XHelper.Read("IsSubGraphExpanded", e, true); this.WasSubGraphExpanded = XHelper.Read("WasSubGraphExpanded", e, false); this.SubGraphKey = XHelper.Read<NodeKey>("SubGraphKey", e, default(NodeKey), ConvertStringToNodeKey); this.MemberKeys = (IList<NodeKey>)XHelper.ReadElements<NodeKey>(e.Element("MemberKeys"), "Key", new ObservableCollection<NodeKey>(), ConvertStringToNodeKey); this.Location = XHelper.Read("Location", e, new Point(Double.NaN, Double.NaN)); this.Text = XHelper.Read("Text", e, ""); }
If you add properties to this node data class, and if you are using the GraphLinksModel<NodeType,NodeKey,PortKey,LinkType>.Save<NodeDataType,LinkDataType> and GraphLinksModel<NodeType,NodeKey,PortKey,LinkType>.Load<NodeDataType,LinkDataType> methods, you should override this method to add new attributes and/or elements as needed, and you should override MakeXElement.